import {defineStore} from 'pinia'
import request from '@/uitils/request'
import {GoodsInfo,ApiRes} from '@/types/data'
const useGoodsStore=defineStore('goods',{
    state(){
        return{
            goodsInfo:{} as GoodsInfo
        }
    },
    actions:{
        // 商品详情
    async getGoodsInfo(id:string){
        const res=await request.get<ApiRes<GoodsInfo>>('/goods',{params:{id}})
        this.goodsInfo=res.data.result
      }
    },
    getters:{}
})
export default useGoodsStore